const { success } = require('./output')

// 判断条件 通过则输出成功信息 否则抛出错误信息
module.exports = (condition, successMsg, failMsg) => {
  if (condition) {
    successMsg && success(successMsg)
  } else {
    throw failMsg
  }
}